<template>
  <div class="app-container">
    <list-page-container>
      <template slot="query">
        <el-form :model="tableQueryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
          <el-form-item label="业务人员姓名" prop="businessPersonName">
            <el-input
                v-model="tableQueryParams.businessPersonName"
                placeholder="请输入业务人员姓名"
                clearable
            >
            </el-input>
          </el-form-item>
          <el-form-item label="种植类型" prop="plantType">
            <el-input
                v-model="tableQueryParams.plantType"
                placeholder="请输入种植类型"
                clearable
            >
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
      </template>

<!--      <template slot="rowHandel">-->
<!--        <el-button type="primary" icon="el-icon-plus"-->
<!--                   size="mini" @click="handleAdd">新增险种-->
<!--        </el-button>-->
<!--      </template>-->

      <template slot="table">
        <el-table @sort-change="handleSortChange" height="100%" v-loading="loading" :data="dataList">
          <el-table-column label="业务人员姓名" align="center" prop="businessPersonName"/>
          <el-table-column label="业务人员联系方式" align="center" prop="businessPersonContact"/>
          <el-table-column label="种植作物类型" align="center" prop="plantType"/>
          <el-table-column label="联系方式" align="center" prop="contact"/>
          <el-table-column label="受灾描述" align="center" prop="disasterDesc"/>

        </el-table>
      </template>

      <template slot="pageDisplay">
        <pagination
            v-show="total>0"
            :total="total"
            :page.sync="tableQueryParams.pageNum"
            :limit.sync="tableQueryParams.pageSize"
            @pagination="getList"
        />
      </template>
    </list-page-container>

    <el-drawer
        class="diy-draw"
        :title="title"
        :wrapperClosable="false"
        :visible.sync="open">
      <drawer-content>
        <template slot="body">
          <el-scrollbar>
            <el-form v-if="open"  :model="form" ref="form" size="small"
                     label-width="80px">
              <el-form-item class="column-item" label="险种代码" prop="insuranceTypeCode">
                <el-input
                    v-model="form.insuranceTypeCode"
                    placeholder="请输入险种代码"
                    type="textarea"
                    clearable
                >
                </el-input>
              </el-form-item>
              <el-form-item class="column-item" label="险种名称" prop="insuranceTypeName">
                <el-input
                    v-model="form.insuranceTypeName"
                    placeholder="请输入险种名称"
                    type="textarea"
                    clearable
                >
                </el-input>
              </el-form-item>
            </el-form>
          </el-scrollbar>
        </template>
        <template slot="footer">
          <el-button type="primary" icon="el-icon-plus" size="mini" @click="submitData">确定</el-button>
        </template>
      </drawer-content>
    </el-drawer>

  </div>

</template>

<script>
import {listPageMixins} from "@/mixins/listPageMixins";
import ShowFileList from "@/components/ShowFileList/index.vue";
import {
  queryReportList,
  getReport,
} from "@/api/reportInformation";
import {HIDDEN_DANGER_WIDTH} from "@/constantData";

export default {
  name:'reportInformation',
  mixins: [listPageMixins],
  components: {
    ShowFileList,
  },
  data() {
    return {
      HIDDEN_DANGER_WIDTH,
      modelName: '险种',
      // 查询参数
      queryParams: {
        // 业务人员姓名
        businessPersonName: null,
        // 种植类型
        plantType: null,
      },
      otherQueryParam: {
      },
      getListFun: queryReportList,
      getInfoFun: getReport,
      baseForm: {
        id: null,
        // 险种名称
        insuranceTypeName: null,
        // 险种代码
        insuranceTypeCode: null,
      },

    }
  },
  methods:{
    childBearingPeriodManager(typesOfInsurance){
      let {insuranceTypeCode:insuranceType} = typesOfInsurance
      this.$router.push({path: '/system/childBearingPeriod', query: {insuranceType}})
    }
  }
}
</script>

<style scoped>

</style>
